package com.youhong.teethcare.decorators;

import android.content.Context;
import android.graphics.Typeface;
import android.graphics.drawable.Drawable;
import android.text.style.RelativeSizeSpan;
import android.text.style.StyleSpan;

import com.prolificinteractive.materialcalendarview.CalendarDay;
import com.prolificinteractive.materialcalendarview.DayViewDecorator;
import com.prolificinteractive.materialcalendarview.DayViewFacade;
import com.youhong.teethcare.R;

import java.util.Calendar;

/**
 * Use a custom selector
 */
public class BiggerTextDecorator implements DayViewDecorator {


    Calendar c_selected;

    public BiggerTextDecorator(Context context, Calendar calendar) {
        c_selected = calendar;
    }

    @Override
    public boolean shouldDecorate(CalendarDay day) {

        if (day.getYear() == c_selected.get(Calendar.YEAR)
                && day.getMonth() == c_selected.get(Calendar.MONTH)
                && day.getDay() == c_selected.get(Calendar.DAY_OF_MONTH)
                ) {

            return true;

        }
        return false;
    }

    @Override
    public void decorate(DayViewFacade view) {

        view.addSpan(new StyleSpan(Typeface.BOLD));
        view.addSpan(new RelativeSizeSpan(1.2f));
    }
}
